package com.xp.ai.chat.ollama;

import com.xp.ai.util.ModelUtils;
import dev.langchain4j.model.chat.ChatLanguageModel;
import dev.langchain4j.model.moderation.Moderation;
import dev.langchain4j.model.moderation.ModerationModel;
import dev.langchain4j.model.output.Response;

/**
 * 简单的聊天
 */
public class OllamaSimpleChat {

    public static void main(String[] args) {

//        ChatLanguageModel model = ModelUtils.getOllamaNormalModel();
//        String helloWorld = model.chat("杀人偿命，天经地义");
//        System.out.println(helloWorld);
        //deepseek1.5b 好像不支持 json
//        ChatLanguageModel model = ModelUtils.getJsonOllamaModel();

        //这个目前 只有 Openai支持
//        ModerationModel moderationModel = ModelUtils.getHuoshanModerationModel();
//        Response<Moderation> moderate = moderationModel.moderate("杀人偿命，天经地义");
//        String text = moderate.content().flaggedText();
//        System.out.println(text);

    }
}
